//
//  Person_listTableViewCell.m
//  fxxiaoke
//
//  Created by 鞠超 on 2016/11/2.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "Person_listTableViewCell.h"

@implementation Person_listTableViewCell

- (instancetype )initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self)
    {
        [self p_setupView];
    }
    
    return self;
}

- (void )p_setupView
{
    self.image = [[UIImageView alloc] init];
    self.image.layer.cornerRadius = 20;
    self.image.layer.masksToBounds = YES;
    self.image.image = [UIImage imageNamed:@"heads.jpg"];
    [self.contentView addSubview:self.image];
    
    self.name = [[UILabel alloc] init];
    self.name.text = @"员工名字";
    self.name.textColor = [UIColor blackColor];
    [self.contentView addSubview:self.name];
    
    self.detail = [[UILabel alloc] init];
    self.detail.text = @"负责人";
    self.detail.font = [UIFont systemFontOfSize:14.0f];
    self.detail.textColor = [UIColor blackColor];
    [self.contentView addSubview:self.detail];
    
    self.view_Line = [[UIView alloc] init];
    self.view_Line.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:self.view_Line];
}

- (void )layoutSubviews
{
    [super layoutSubviews];
    
    self.image.frame = CGRectMake(10, 10, 40, 40);
    
    self.name.frame = CGRectMake(CGRectGetMaxX(self.image.frame) + 8, 10, SCREEN_WIDTH - CGRectGetMaxX(self.image.frame) - 8 - 10, 20);
    
    self.detail.frame = CGRectMake(CGRectGetMaxX(self.image.frame) + 8, 34, SCREEN_WIDTH - CGRectGetMaxX(self.image.frame) - 8 - 10, 15);
    
    self.view_Line.frame = CGRectMake(CGRectGetMaxX(self.image.frame) + 8, 59, SCREEN_WIDTH - CGRectGetMaxX(self.image.frame) - 8, 1);
}



@end
